package com.ynny.List;

import java.util.ArrayList;
import java.util.List;

public class PersonTest {
    public static void main(String[] args) {

        List<Person> personList=new ArrayList<>();

        personList.add(new Person("张桐",18,"男",1));
        personList.add(new Person("引海",18,"女",2));
        personList.add(new Person("牛梦婷",18,"女",3));

        for (Person person:personList){
            System.out.println("姓名:" + person.getName() +",id:" +person.getId()+",年龄："
                    + person.getAge() +",性别:" +person.getSex());
        }

    }

}
